/*
 * ElementData.h
 *
 *  Created on: May 29, 2011
 *      Author: madboyka
 */

#ifndef ELEMENTDATA_H_
#define ELEMENTDATA_H_
#include "elementconfig.h"
/*!
 * The ElementData class holds data for primitive physical shapes or meshes.
 * This is used by the viewer for rendering the desired element.
 * It is also used by the server for getting element data from obstacle and robots.
 */
class ElementData
{
public:
	/*!
	 * Construct an ElementData with the given ElementType.
	 */
	ElementData(ElementType = NoType);
	/*!
	 * Copy constructor
	 */
	ElementData(const ElementData&);
	virtual ~ElementData();

	/*!
	 * Sets n number of element specific data on this object. Not used on Meshes.
	 */
	void setData(int, float*);
	/*!
	 * Returns the stored element specific data. Not used on Meshes.
	 */
	float* getData() const;
	/*!
	 * Returns the number of stored element specific datas.Not used on Meshes.
	 */
	int getDataCount() const;

	/*!
	 * Sets the Mesh name for this element. Only used on Meshes.
	 */
	void setMeshType(const char*);
	/*!
	 * Gets the Mesh name for this element. Only used on Meshes.
	 */
	char* getMeshType() const;

	/*!
	 * Sets the transformation(location) matrix for this element.
	 */
	void setTransformationMatrix(float*);
	/*!
	 * Gets the transformation(location) matrix for this element.
	 */
	float* getTransformationMatrix() const;

	/*!
	 * Sets the color of the element, designated by the red, green and blue color components.
	 */
	void setColor(unsigned char, unsigned char, unsigned char);
	/*!
	 * Returns an array of 3 elements containing the  red, green and blue color components.
	 */
	unsigned char* getColor() const;

	/*!
	 * Returns the ElementType of this element.
	 */
	ElementType getElementType() const;

protected:
	void *data;
	float* transformationMatrix;
	ElementType elementType;
	int dataCount;
	unsigned char color[3];
private:
};

#endif /* ELEMENTDATA_H_ */
